package com.aruba.drawerapplication;

import android.os.Bundle;
import android.support.v4.view.GravityCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
    MyDrawerLayout myDrawerLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        myDrawerLayout = findViewById(R.id.dl_demo);
        SlideLinearLayout llSlide = findViewById(R.id.ll_slide);
        llSlide.setItemClickListener(new SlideLinearLayout.ItemClickListener() {
            @Override
            public void onItemClickListener(View view, int position) {
                Toast.makeText(MainActivity.this, "click:" + position, Toast.LENGTH_SHORT).show();
                myDrawerLayout.closeDrawer(GravityCompat.START);
            }
        });


    }
}
